
/*author- Sachini Attanayake- st20000417
*@brief -  decodes frist three charaters of rx buffer  as action, room and onoff
* action  (1: change 0:review ) Relay status
* room     ( A,B,C,D,E,F,G,H)
* onoff    (1: on    0:0ff  )
*/



char action;
char room;
char onoff;

void save_action(char input_action){
	switch (input_action){
		case '0': action = '0'; break; // review
		case '1': action= '1' ; break; //change
	
	default : action = 'N'; break; // anything else
	

}
	}

	
	
	void save_room(char input_room){
	switch (input_room){
		case 'A': room = 'A'; break; // room A
		case 'B': room= 'B' ; break; // room B
		case 'C': room = 'C'; break; // room C
		case 'D': room= 'D' ; break; //room D
	  case 'E': room = 'E'; break; // room E
		case 'F': room= 'F' ; break; // room F
		case 'G': room = 'G'; break; // room G
		case 'H': room= 'H' ; break; // room H
	default : room = 'N'; break; // anything else
	

}
	}
	

	
	
void save_onoff(char input_onoff){
	switch (input_onoff){
		case '0': onoff = '0'; break; // review
		case '1': onoff= '1' ; break; //change
	
	default : onoff = 'N'; break; // anything else
	

}
	}	
	
char get_action(){
return action;
}

char get_room(){
return room;
}


char get_onoff(){
return onoff;
}
